<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
<!-- 标题 -->
<div class="page-heade clearfix">
    <h2 class="clearfix text-center">
        <a class="col-md-6 title_color H_right" id="Ap1" style="font-size: 16px;color:#333;" href="{:url('ssxsdd')}">所属销售订单查询</a>
        <a class="col-md-6 title_color H_active" id="Ap2" style=" font-size: 16px;">所属销售订单明细查询</a>
    </h2>
</div>
<!-- 标题 -->
<div>
    <form action="" class="form-inline">
        <table class="row-margin-top tab-content table-bordered table text-left" border="1">
            <tr>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">分区：</label></td>
                <td><input type="text" class="form-control" name="zoning" value="{$zoning}"></td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">省份：</label></td>
                <td><input type="text" class="form-control" name="provice" value="{$provice}"></td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">城市：</label>
                </td>
                <td><input type="text" class="form-control" name="city" value="{$city}"></td>
            </tr>
            <tr>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">对应销售订单号：</label></td>
                <td><input type="text" class="form-control" name="ordersn" value="{$ordersn}"></td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">经销商编号：</label></td>
                <td><input type="text" class="form-control" name="jxssn" value="{$jxssn}"></td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">经销商名称：</label>
                </td>
                <td><input type="text" class="form-control" name="jxsname" value="{$jxsname}"></td>
            </tr>
            <tr>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">申请状态：</label></td>
                <td>
                    <select name="applyStatus" id="applystatus" class="form-control select">
                        <option value="">请选择</option>
                        <option value="1" {if $applyStatus==1}selected{/if}>已批准</option>
                        <option value="2" {if $applyStatus==2}selected{/if}>未批准</option>
                    </select>
                </td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">物料类型：</label></td>
                <td>
                    <select name="wllx" id="wllx" class="form-control select">
                        <option value="">请选择</option>
                        {volist name="wllxs" id="row"}
                        <option value="{$row.id}">{$row.type_name}</option>
                        {/volist}
                    </select>
                </td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">销售类型：</label>
                </td>
                <td>
                    <select name="xslx" id="xslx" class="form-control select">
                        <option value="">请选择</option>
                        <option value="1">成品</option>
                        <option value="2">销售物料</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="min-width: 160px" class="text-right"><label for="sku" class="form-label"> SKU：</label></td>
                <td><input type="text" class="form-control" name="sku" id="sku"></td>
                <td style="min-width: 160px" class="text-right"><label for="wlbm" class="form-label"> 物料编码：</label></td>
                <td><input type="text" class="form-control" name="wlbm" id="wlbm"></td>
                <td style="min-width: 160px" class="text-right"><label for="wlmc" class="form-label"> 物料名称：</label>
                </td>
                <td><input type="text" class="form-control" name="wlmc" id="wlmc"></td>
            </tr>
            <tr>
                <td style="min-width: 160px" class="text-right"><label for="category" class="form-label"> 品类：</label>
                </td>
                <td><input type="text" class="form-control" name="category" id="category"></td>
                <td style="min-width: 160px" class="text-right"><label for="" class="form-label">时间段：</label>
                </td>
                <td>
                    <div class="form-group">
                        <input type="text" id="start" name="start" class="form-control layer-date "
                               style="min-width: 100px;width: 100px; display: inline-block;">
                    </div>
                    <div class="form-group">
                        至
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control layer-date"
                               style="min-width: 100px;width: 100px; display: inline-block;" id="end" name="end">
                    </div>
                </td>
                <td colspan="2"></td>
            </tr>
            <tr>
                <td colspan="6" class="text-center">
                    <button class="btn btn-info query" type="submit">查询</button>
                    <button class="btn btn-info emptyIf" type="button">清空</button>
                    <button class="btn btn-info LendExcel" type="button">导出Excel</button>
                </td>
            </tr>
        </table>
        <p>订货数量合计：{$hj1}；搭赠数量合计：{$hj2}；应收金额合计(元)：{$hj3}</p>
        <table class="table table-striped row-margin-top table-bordered text-center bud_hei">
            <thead>
            <tr class="info text-center">
                <th class="text-center">NO.</th>
                <th class="text-center">分区</th>
                <th class="text-center">省份</th>
                <th class="text-center">城市</th>
                <th class="text-center">时间</th>
                <th class="text-center">对应销售订单编号</th>
                <th class="text-center">经销商编号</th>
                <th class="text-center">经销商名称</th>
                <th class="text-center">申请状态</th>
                <th class="text-center">品类</th>
                <th class="text-center">SKU</th>
                <th class="text-center">物料编码</th>
                <th class="text-center">物料名称</th>
                <th class="text-center">规格</th>
                <th class="text-center">物料类型</th>
                <th class="text-center">销售类型</th>
                <th class="text-center">单位</th>
                <th class="text-center">供货单价(元)</th>
                <th class="text-center">订货数量</th>
                <th class="text-center">搭赠数量</th>
                <th class="text-center">货补数量</th>
                <th class="text-center">发货数量</th>
                <th class="text-center">收货数量</th>
                <th class="text-center">原金额(元)</th>
                <th class="text-center">应收金额(元)</th>
                <th class="text-center">体积(立方米)</th>
                <th class="text-center">重量(吨)</th>
            </tr>
            </thead>
            <tbody>
            {volist name="data" id="row" key="k"}
            <tr class="text-center">
                <td class="text-center">{$k+((request()->param('page')?request()->param('page'):1)-1)*10}</td>
                <td class="text-center">{$row.zoning}</td>
                <td class="text-center">{$row.provice}</td>
                <td class="text-center">{$row.city}</td>
                <td class="text-center">{$row.jyfhrq}</td>
                <td class="text-center">{$row.sn}</td>
                <td class="text-center">{$row.jxs_sn}</td>
                <td class="text-center">{$row.jxs_name}</td>
                <td class="text-center">{$row.status}</td>
                <td class="text-center">{$row.category}</td>
                <td class="text-center">{$row.sku}</td>
                <td class="text-center">{$row.prod_sn}</td>
                <td class="text-center">{$row.pro_name}</td>
                <td class="text-center">{$row.format}</td>
                <td class="text-center">{$row.wllx}</td>
                <td class="text-center">{if $row.kind==1}成品{else}销售物料{/if}</td>
                <td class="text-center">{$row.unit}</td>
                <td class="text-center">{$row.xgj}</td>
                <td class="text-center">{$row.num}</td>
                <td class="text-center">{$row.dzsl}</td>
                <td class="text-center">{$row.hbsl}</td>
                <td class="text-center">{$row.fhsl}</td>
                <td class="text-center">{$row.shsl}</td>
                <td class="text-center">{$row.yje}</td>
                <td class="text-center">{$row.ysje}</td>
                <td class="text-center">{$row.tj}</td>
                <td class="text-center">{$row.zl}</td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </form>
</div>
<!-- 全局js -->
{include file="Public/footer"}
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!--统计代码，可删除-->
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script>
    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY/MM/DD',
        min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {

        elem: '#end',
        format: 'YYYY/MM/DD',
        min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    $('.emptyIf').on('click', function () {
        var form = $(this).closest('form')
        form.find('input[type=text]').each(function (i, o) {
            $(o).val('')
        })
        form.submit()
    })
    $('.LendExcel').on('click',function () {
        window.open('{:url("excel2")}')
    })
</script>
</body>

</html>
